package cn.tedu.shoot;
import java.awt.Graphics;
import java.awt.image.BufferedImage;
import java.util.Random;


public class Boss extends FlyingObject implements Enemy{
	private int life;
	private int xSpeed;
	public Boss() {
		super(221,213,146,40);
		life=150;
		
		
	}

	
	public void step() {
		
		
	}

	int index=1;
	public BufferedImage getImage() {
		if(isLife()) {
			return Images.boss[0];
		}else if(isDead()) {
			BufferedImage img=Images.boss[index++];
			if(index==Images.boss.length) {
				state=REMOVE;
			}
			return img;
		}
		return null;
		
	}
	public BossBullet[] shoot() {
		int yStep=this.height;
		Random rand=new Random();
		BossBullet[]bs=new BossBullet[rand.nextInt(4)+8];
		
		for(int i=0;i<bs.length;i++) {
			int a=this.x+rand.nextInt(this.width);
			bs[i]=new BossBullet(a,this.y+yStep);
			bs[i].xset(rand.nextInt(4)-2);
			bs[i].yset(rand.nextInt(3)+1);
		}
		return bs;
	}
	public int getLife() {
		return life;
	}
	public void subtractLife() {
		life--;
	}
	public int getScore() {
		return 50;
	}
	public void laserSubtractLife() {
		life-=1;
	}
	

}
